package br.com.extrajudicial.dao;

import java.util.List;

import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;

import br.com.caelum.vraptor.ioc.Component;
import br.com.extrajudicial.models.Item;

@Component
public class ItemDao extends GenericDao<Item> {

	@SuppressWarnings("unchecked")
	public List<Item> search(String name) {
		return this.getSession().createCriteria(Item.class)
			.add(Restrictions.ilike("name", name, MatchMode.ANYWHERE))
			.list();
	}

}
